#include "common.h"
#include <stdio.h>

int main(int argc, char *argv[])
{
	if(argc <= 1)
		err_sys("Argument error!\n");

	int i = 0;
	int j = 0;
	pid_t pid;
/*
	pid = fork();
	if(pid < 0)
		err_sys("fork error\n");
	else 
	{
		for(i = 1; i < 6; i++)
		{
			sleep(argv[i]);
			//printf("%d\n", argv[i]);
			exit(0);
		}
	
	}
*/
	for(i = 1; i < argc; i++)
	{
		pid = fork();
		if(pid < 0)
			err_sys("fork error\n");
		else if(pid == 0)
		{
			j = atoi(argv[i]);
			sleep(j);
			printf("%s\n", argv[i]);
			exit(0);
		}
	}

	exit(0);
}
